// Copyright 2021 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package sql

import (
	"math"
	"strings"
	"sync"
)

// SystemVariableScope represents the scope of a system variable.
type SystemVariableScope byte

const (
	// SystemVariableScope_Global is set when the system variable exists only in the global context.
	SystemVariableScope_Global SystemVariableScope = iota
	// SystemVariableScope_Session is set when the system variable exists only in the session context.
	SystemVariableScope_Session
	// SystemVariableScope_Both is set when the system variable exists in both the global and session contexts.
	SystemVariableScope_Both
)

// String returns the scope as an uppercase string.
func (s SystemVariableScope) String() string {
	switch s {
	case SystemVariableScope_Global:
		return "GLOBAL"
	case SystemVariableScope_Session:
		return "SESSION"
	case SystemVariableScope_Both:
		return "GLOBAL, SESSION"
	default:
		return "UNKNOWN_SYSTEM_SCOPE"
	}
}

// SystemVariable represents a system variable.
type SystemVariable struct {
	// Name is the name of the system variable.
	Name string
	// Scope defines the scope of the system variable, which is either Global, Session, or Both.
	Scope SystemVariableScope
	// Dynamic defines whether the variable may be written to during runtime. Variables with this set to `false` will
	// return an error if a user attempts to set a value.
	Dynamic bool
	// SetVarHintApplies defines if the variable may be set for a single query using SET_VAR().
	// https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html#optimizer-hints-set-var
	SetVarHintApplies bool
	// Type defines the type of the system variable. This may be a special type not accessible to standard MySQL operations.
	Type Type
	// Default defines the default value of the system variable.
	Default interface{}
}

// globalSystemVariables is the underlying type of SystemVariables.
type globalSystemVariables struct {
	mutex      *sync.RWMutex
	sysVarVals map[string]interface{}
}

// SystemVariables is the collection of system variables for this process.
var SystemVariables = &globalSystemVariables{&sync.RWMutex{}, make(map[string]interface{})}

// AddSystemVariables adds the given system variables to the collection. If a name is already used by an existing
// variable, then it is overwritten with the new one.
func (sv *globalSystemVariables) AddSystemVariables(sysVars []SystemVariable) {
	sv.mutex.Lock()
	defer sv.mutex.Unlock()
	for _, originalSysVar := range sysVars {
		sysVar := originalSysVar
		lowerName := strings.ToLower(sysVar.Name)
		sysVar.Name = lowerName
		systemVars[lowerName] = sysVar
		sv.sysVarVals[lowerName] = sysVar.Default
	}
}

// AssignValues sets all of the values in the given map to their respective variables. If a variable cannot be found, or
// the value is invalid, then an error is returned. If the values contain any custom system variables, then make sure
// that they've been added using AddSystemVariables first.
func (sv *globalSystemVariables) AssignValues(vals map[string]interface{}) error {
	sv.mutex.Lock()
	defer sv.mutex.Unlock()
	for varName, val := range vals {
		varName = strings.ToLower(varName)
		sysVar, ok := systemVars[varName]
		if !ok {
			return ErrUnknownSystemVariable.New(varName)
		}
		convertedVal, err := sysVar.Type.Convert(val)
		if err != nil {
			return err
		}
		sv.sysVarVals[varName] = convertedVal
	}
	return nil
}

// NewSessionMap returns a new map of system variable values for sessions.
func (sv *globalSystemVariables) NewSessionMap() map[string]interface{} {
	sv.mutex.RLock()
	defer sv.mutex.RUnlock()
	sessionVals := make(map[string]interface{}, len(sv.sysVarVals))
	for key, val := range sv.sysVarVals {
		sessionVals[key] = val
	}
	return sessionVals
}

// GetGlobal returns the system variable definition and value for the given name. If the variable does not exist, returns
// false. Case-insensitive.
func (sv *globalSystemVariables) GetGlobal(name string) (SystemVariable, interface{}, bool) {
	sv.mutex.RLock()
	defer sv.mutex.RUnlock()
	name = strings.ToLower(name)
	v, ok := systemVars[name]
	if ok {
		return v, sv.sysVarVals[name], true
	}
	return SystemVariable{}, nil, false
}

// SetGlobal sets the system variable with the given name to the given value. If the system variable does not exist,
// then an error is returned. Additionally, if the value is invalid for the variable's type then an error is returned.
// Only global dynamic variables may be set through this function, as it is intended for use through the SET GLOBAL
// statement. To set session system variables, use the appropriate function on the session context. To set values
// directly (such as when loading persisted values), use AssignValues. Case-insensitive.
func (sv *globalSystemVariables) SetGlobal(name string, val interface{}) error {
	sv.mutex.Lock()
	defer sv.mutex.Unlock()
	name = strings.ToLower(name)
	sysVar, ok := systemVars[name]
	if !ok {
		return ErrUnknownSystemVariable.New(name)
	}
	if sysVar.Scope == SystemVariableScope_Session {
		return ErrSystemVariableSessionOnly.New(name)
	}
	if !sysVar.Dynamic {
		return ErrSystemVariableReadOnly.New(name)
	}
	convertedVal, err := sysVar.Type.Convert(val)
	if err != nil {
		return err
	}
	sv.sysVarVals[name] = convertedVal
	return nil
}

// init initializes SystemVariables as it functions as a global variable.
func init() {
	for _, sysVar := range systemVars {
		SystemVariables.sysVarVals[sysVar.Name] = sysVar.Default
	}
}

//TODO: Add from the following sources because MySQL likes to not have every variable on a single page:
// https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-options-variables.html
// There's also this page, which shows that a TON of variables are still missing ):
// https://dev.mysql.com/doc/refman/8.0/en/server-system-variable-reference.html

// systemVars is the internal collection of all MySQL system variables according to the following pages:
// https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
// https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html
// https://dev.mysql.com/doc/refman/8.0/en/replication-options-source.html
var systemVars = map[string]SystemVariable{
	"activate_all_roles_on_login": {
		Name:              "activate_all_roles_on_login",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("activate_all_roles_on_login"),
		Default:           int8(0),
	},
	"admin_address": {
		Name:              "admin_address",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_address"),
		Default:           "",
	},
	"admin_port": {
		Name:              "admin_port",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("admin_port", 0, 65535, false),
		Default:           int64(33062),
	},
	"admin_ssl_ca": {
		Name:              "admin_ssl_ca",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_ca"),
		Default:           "",
	},
	"admin_ssl_capath": {
		Name:              "admin_ssl_capath",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_capath"),
		Default:           "",
	},
	"admin_ssl_cert": {
		Name:              "admin_ssl_cert",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_cert"),
		Default:           "",
	},
	"admin_ssl_cipher": {
		Name:              "admin_ssl_cipher",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_cipher"),
		Default:           "",
	},
	"admin_ssl_crl": {
		Name:              "admin_ssl_crl",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_crl"),
		Default:           "",
	},
	"admin_ssl_crlpath": {
		Name:              "admin_ssl_crlpath",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_crlpath"),
		Default:           "",
	},
	"admin_ssl_key": {
		Name:              "admin_ssl_key",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_ssl_key"),
		Default:           "",
	},
	"admin_tls_ciphersuites": {
		Name:              "admin_tls_ciphersuites",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_tls_ciphersuites"),
		Default:           "",
	},
	"admin_tls_version": {
		Name:              "admin_tls_version",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("admin_tls_version"),
		Default:           "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3",
	},
	"authentication_windows_log_level": {
		Name:              "authentication_windows_log_level",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("authentication_windows_log_level", 0, 4, false),
		Default:           int64(2),
	},
	"authentication_windows_use_principal_name": {
		Name:              "authentication_windows_use_principal_name",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("authentication_windows_use_principal_name"),
		Default:           int8(1),
	},
	"autocommit": {
		Name:              "autocommit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("autocommit"),
		Default:           int8(1),
	},
	"automatic_sp_privileges": {
		Name:              "automatic_sp_privileges",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("automatic_sp_privileges"),
		Default:           int8(1),
	},
	"auto_generate_certs": {
		Name:              "auto_generate_certs",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("auto_generate_certs"),
		Default:           int8(1),
	},
	"auto_increment_increment": {
		Name:              "auto_increment_increment",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("auto_increment_increment", 1, 65535, false),
		Default:           int64(1),
	},
	"auto_increment_offset": {
		Name:              "auto_increment_offset",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("auto_increment_offset", 1, 65535, false),
		Default:           int64(1),
	},
	"avoid_temporal_upgrade": {
		Name:              "avoid_temporal_upgrade",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("avoid_temporal_upgrade"),
		Default:           int8(0),
	},
	"back_log": {
		Name:              "back_log",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("back_log", 1, 65535, true),
		Default:           int64(-1),
	},
	//TODO: add to dolt
	"basedir": {
		Name:              "basedir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("basedir"),
		Default:           "",
	},
	"big_tables": {
		Name:              "big_tables",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("big_tables"),
		Default:           int8(0),
	},
	"bind_address": {
		Name:              "bind_address",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("bind_address"),
		Default:           "*",
	},
	"binlog_gtid_simple_recovery": {
		Name:              "binlog_gtid_simple_recovery",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("binlog_gtid_simple_recovery"),
		Default:           int8(1),
	},
	"block_encryption_mode": {
		Name:              "block_encryption_mode",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("block_encryption_mode"),
		Default:           "aes-128-ecb",
	},
	"bulk_insert_buffer_size": {
		Name:              "bulk_insert_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("bulk_insert_buffer_size", 0, 18446744073709551615),
		Default:           uint64(8388608),
	},
	"caching_sha2_password_digest_rounds": {
		Name:              "caching_sha2_password_digest_rounds",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("caching_sha2_password_digest_rounds", 5000, 4095000, false),
		Default:           int64(5000),
	},
	"caching_sha2_password_auto_generate_rsa_keys": {
		Name:              "caching_sha2_password_auto_generate_rsa_keys",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("caching_sha2_password_auto_generate_rsa_keys"),
		Default:           int8(1),
	},
	"caching_sha2_password_private_key_path": {
		Name:              "caching_sha2_password_private_key_path",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("caching_sha2_password_private_key_path"),
		Default:           "private_key.pem",
	},
	"caching_sha2_password_public_key_path": {
		Name:              "caching_sha2_password_public_key_path",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("caching_sha2_password_public_key_path"),
		Default:           "public_key.pem",
	},
	"character_set_client": {
		Name:              "character_set_client",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_client"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_set_connection": {
		Name:              "character_set_connection",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_connection"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_set_database": {
		Name:              "character_set_database",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_database"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_set_filesystem": {
		Name:              "character_set_filesystem",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_filesystem"),
		Default:           "binary",
	},
	"character_set_results": {
		Name:              "character_set_results",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_results"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_set_server": {
		Name:              "character_set_server",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_server"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_set_system": {
		Name:              "character_set_system",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_set_system"),
		Default:           Collation_Default.CharacterSet().String(),
	},
	"character_sets_dir": {
		Name:              "character_sets_dir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("character_sets_dir"),
		Default:           "",
	},
	"check_proxy_users": {
		Name:              "check_proxy_users",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("check_proxy_users"),
		Default:           int8(0),
	},
	"collation_connection": {
		Name:              "collation_connection",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("collation_connection"),
		Default:           Collation_Default.String(),
	},
	"collation_database": {
		Name:              "collation_database",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("collation_database"),
		Default:           Collation_Default.String(),
	},
	"collation_server": {
		Name:              "collation_server",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("collation_server"),
		Default:           Collation_Default.String(),
	},
	"completion_type": {
		Name:              "completion_type",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("completion_type", "NO_CHAIN", "CHAIN", "RELEASE"),
		Default:           "NO_CHAIN",
	},
	"concurrent_insert": {
		Name:              "concurrent_insert",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("concurrent_insert", "NEVER", "AUTO", "ALWAYS"),
		Default:           "AUTO",
	},
	"connect_timeout": {
		Name:              "connect_timeout",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("connect_timeout", 2, 31536000, false),
		Default:           int64(10),
	},
	"core_file": {
		Name:              "core_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("core_file"),
		Default:           int8(0),
	},
	"create_admin_listener_thread": {
		Name:              "create_admin_listener_thread",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("create_admin_listener_thread"),
		Default:           int8(0),
	},
	"cte_max_recursion_depth": {
		Name:              "cte_max_recursion_depth",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("cte_max_recursion_depth", 0, 4294967295, false),
		Default:           int64(1000),
	},
	"datadir": {
		Name:              "datadir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("datadir"),
		Default:           "",
	},
	"debug_sync": {
		Name:              "debug_sync",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("debug_sync"),
		Default:           "",
	},
	"default_authentication_plugin": {
		Name:              "default_authentication_plugin",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("default_authentication_plugin", "mysql_native_password", "sha256_password", "caching_sha2_password"),
		Default:           "caching_sha2_password",
	},
	"default_collation_for_utf8mb4": {
		Name:              "default_collation_for_utf8mb4",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("default_collation_for_utf8mb4", "utf8mb4_0900_ai_ci", "utf8mb4_general_ci"),
		Default:           "utf8mb4_0900_ai_ci",
	},
	"default_password_lifetime": {
		Name:              "default_password_lifetime",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("default_password_lifetime", 0, 65535, false),
		Default:           int64(0),
	},
	"default_storage_engine": {
		Name:              "default_storage_engine",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("default_storage_engine", "MEMORY", "MRG_MYISAM", "CSV", "FEDERATED", "PERFORMANCE_SCHEMA", "MyISAM", "InnoDB", "BLACKHOLE", "ARCHIVE"),
		Default:           "InnoDB",
	},
	"default_table_encryption": {
		Name:              "default_table_encryption",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("default_table_encryption"),
		Default:           int8(0),
	},
	"default_tmp_storage_engine": {
		Name:              "default_tmp_storage_engine",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemEnumType("default_tmp_storage_engine", "MEMORY", "MRG_MYISAM", "CSV", "FEDERATED", "PERFORMANCE_SCHEMA", "MyISAM", "InnoDB", "BLACKHOLE", "ARCHIVE"),
		Default:           "InnoDB",
	},
	"default_week_format": {
		Name:              "default_week_format",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("default_week_format", 0, 7, false),
		Default:           int64(0),
	},
	"delay_key_write": {
		Name:              "delay_key_write",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("delay_key_write", "ON", "OFF", "ALL"),
		Default:           "ON",
	},
	"delayed_insert_limit": {
		Name:              "delayed_insert_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("delayed_insert_limit", 1, 18446744073709551615),
		Default:           uint64(100),
	},
	"delayed_insert_timeout": {
		Name:              "delayed_insert_timeout",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("delayed_insert_timeout", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(300),
	},
	"delayed_queue_size": {
		Name:              "delayed_queue_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("delayed_queue_size", 1, 18446744073709551615),
		Default:           uint64(1000),
	},
	"disabled_storage_engines": {
		Name:              "disabled_storage_engines",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("disabled_storage_engines"),
		Default:           "",
	},
	"disconnect_on_expired_password": {
		Name:              "disconnect_on_expired_password",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("disconnect_on_expired_password"),
		Default:           int8(1),
	},
	"div_precision_increment": {
		Name:              "div_precision_increment",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("div_precision_increment", 0, 30, false),
		Default:           int64(4),
	},
	"dragnet.log_error_filter_rules": {
		Name:              "dragnet.log_error_filter_rules",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("dragnet.log_error_filter_rules"),
		Default:           "drop",
	},
	"end_markers_in_json": {
		Name:              "end_markers_in_json",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("end_markers_in_json"),
		Default:           int8(0),
	},
	"enforce_gtid_consistency": {
		Name:              "enforce_gtid_consistency",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("enforce_gtid_consistency", "OFF", "ON", "WARN"),
		Default:           "OFF",
	},
	"eq_range_index_dive_limit": {
		Name:              "eq_range_index_dive_limit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("eq_range_index_dive_limit", 0, 4294967295, false),
		Default:           int64(200),
	},
	"event_scheduler": {
		Name:              "event_scheduler",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("event_scheduler", "ON", "OFF", "DISABLED"),
		Default:           "ON",
	},
	"explicit_defaults_for_timestamp": {
		Name:              "explicit_defaults_for_timestamp",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("explicit_defaults_for_timestamp"),
		Default:           int8(1),
	},
	"external_user": {
		Name:              "external_user",
		Scope:             SystemVariableScope_Session,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("external_user"),
		Default:           "",
	},
	"flush": {
		Name:              "flush",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("flush"),
		Default:           int8(0),
	},
	"flush_time": {
		Name:              "flush_time",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("flush_time", 0, 9223372036854775807, false),
		Default:           int64(0),
	},
	"foreign_key_checks": {
		Name:              "foreign_key_checks",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("foreign_key_checks"),
		Default:           int8(1),
	},
	"ft_boolean_syntax": {
		Name:              "ft_boolean_syntax",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ft_boolean_syntax"),
		Default:           `+ -><()~*:""&|`,
	},
	"ft_max_word_len": {
		Name:              "ft_max_word_len",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("ft_max_word_len", 10, 9223372036854775807, false),
		Default:           int64(0),
	},
	"ft_min_word_len": {
		Name:              "ft_min_word_len",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("ft_min_word_len", 1, 9223372036854775807, false),
		Default:           int64(4),
	},
	"ft_query_expansion_limit": {
		Name:              "ft_query_expansion_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("ft_query_expansion_limit", 0, 1000, false),
		Default:           int64(20),
	},
	"ft_stopword_file": {
		Name:              "ft_stopword_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ft_stopword_file"),
		Default:           "",
	},
	"general_log": {
		Name:              "general_log",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("general_log"),
		Default:           int8(0),
	},
	"general_log_file": {
		Name:              "general_log_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("general_log_file"),
		Default:           "host_name.log",
	},
	"generated_random_password_length": {
		Name:              "generated_random_password_length",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("generated_random_password_length", 5, 255, false),
		Default:           int64(20),
	},
	"group_concat_max_len": {
		Name:              "group_concat_max_len",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("group_concat_max_len", 4, 18446744073709551615),
		Default:           uint64(1024),
	},
	"gtid_executed": {
		Name:              "gtid_executed",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("gtid_executed"),
		Default:           "",
	},
	"gtid_executed_compression_period": {
		Name:              "gtid_executed_compression_period",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("gtid_executed_compression_period", 0, 4294967295, false),
		Default:           int64(0),
	},
	"gtid_mode": {
		Name:              "gtid_mode",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("gtid_mode", "OFF", "OFF_PERMISSIVE", "ON_PERMISSIVE", "ON"),
		Default:           "OFF",
	},
	"gtid_next": {
		Name:              "gtid_next",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("gtid_next", "AUTOMATIC", "ANONYMOUS", "UUID:NUMBER"),
		Default:           "AUTOMATIC",
	},
	"gtid_owned": {
		Name:              "gtid_owned",
		Scope:             SystemVariableScope_Both,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("gtid_owned"),
		Default:           "",
	},
	"gtid_purged": {
		Name:              "gtid_purged",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("gtid_purged"),
		Default:           "",
	},
	"have_statement_timeout": {
		Name:              "have_statement_timeout",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("have_statement_timeout"),
		Default:           int8(0),
	},
	"histogram_generation_max_mem_size": {
		Name:              "histogram_generation_max_mem_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("histogram_generation_max_mem_size", 1000000, 18446744073709551615),
		Default:           uint64(20000000),
	},
	"host_cache_size": {
		Name:              "host_cache_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("host_cache_size", 0, 65536, true),
		Default:           int64(-1),
	},
	"hostname": {
		Name:              "hostname",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("hostname"),
		Default:           "",
	},
	"immediate_server_version": {
		Name:              "immediate_server_version",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("immediate_server_version", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(80017),
	},
	"init_connect": {
		Name:              "init_connect",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("init_connect"),
		Default:           "",
	},
	"information_schema_stats_expiry": {
		Name:              "information_schema_stats_expiry",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("information_schema_stats_expiry", 0, 31536000, false),
		Default:           int64(86400),
	},
	"init_file": {
		Name:              "init_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("init_file"),
		Default:           "",
	},
	"inmemory_joins": {
		Name:              "inmemory_joins",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("inmemory_joins"),
		Default:           int8(0),
	},
	"interactive_timeout": {
		Name:              "interactive_timeout",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("interactive_timeout", 1, 9223372036854775807, false),
		Default:           int64(28800),
	},
	"internal_tmp_disk_storage_engine": {
		Name:              "internal_tmp_disk_storage_engine",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("internal_tmp_disk_storage_engine", "MYISAM", "INNODB"),
		Default:           "INNODB",
	},
	"internal_tmp_mem_storage_engine": {
		Name:              "internal_tmp_mem_storage_engine",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemEnumType("internal_tmp_mem_storage_engine", "TempTable", "MEMORY"),
		Default:           "TempTable",
	},
	"join_buffer_size": {
		Name:              "join_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("join_buffer_size", 128, 18446744073709547520),
		Default:           uint64(262144),
	},
	"keep_files_on_create": {
		Name:              "keep_files_on_create",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("keep_files_on_create"),
		Default:           int8(0),
	},
	"key_buffer_size": {
		Name:              "key_buffer_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("key_buffer_size", 8, 18446744073709551615),
		Default:           uint64(8388608),
	},
	"key_cache_age_threshold": {
		Name:              "key_cache_age_threshold",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("key_cache_age_threshold", 100, 18446744073709551615),
		Default:           uint64(300),
	},
	"key_cache_block_size": {
		Name:              "key_cache_block_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("key_cache_block_size", 512, 16384, false),
		Default:           int64(1024),
	},
	"key_cache_division_limit": {
		Name:              "key_cache_division_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("key_cache_division_limit", 1, 100, false),
		Default:           int64(100),
	},
	"large_files_support": {
		Name:              "large_files_support",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("large_files_support"),
		Default:           int8(0),
	},
	"large_pages": {
		Name:              "large_pages",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("large_pages"),
		Default:           int8(0),
	},
	"large_page_size": {
		Name:              "large_page_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("large_page_size", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"last_insert_id": {
		Name:              "last_insert_id",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("last_insert_id", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"lc_messages": {
		Name:              "lc_messages",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("lc_messages"),
		Default:           "en_US",
	},
	"lc_messages_dir": {
		Name:              "lc_messages_dir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("lc_messages_dir"),
		Default:           "",
	},
	"lc_time_names": {
		Name:              "lc_time_names",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("lc_time_names"),
		Default:           "",
	},
	"license": {
		Name:              "license",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("license"),
		Default:           "GPL",
	},
	"local_infile": {
		Name:              "local_infile",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("local_infile"),
		Default:           int8(0),
	},
	"lock_wait_timeout": {
		Name:              "lock_wait_timeout",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("lock_wait_timeout", 1, 31536000, false),
		Default:           int64(31536000),
	},
	"log_error": {
		Name:              "log_error",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("log_error"),
		Default:           "",
	},
	"log_error_services": {
		Name:              "log_error_services",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("log_error_services"),
		Default:           "log_filter_internal; log_sink_internal",
	},
	"log_error_suppression_list": {
		Name:              "log_error_suppression_list",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("log_error_suppression_list"),
		Default:           "",
	},
	"log_error_verbosity": {
		Name:              "log_error_verbosity",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("log_error_verbosity", 1, 3, false),
		Default:           int64(2),
	},
	"log_output": {
		Name:              "log_output",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemSetType("log_output", "TABLE", "FILE", "NONE"),
		Default:           "FILE",
	},
	"log_queries_not_using_indexes": {
		Name:              "log_queries_not_using_indexes",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_queries_not_using_indexes"),
		Default:           int8(0),
	},
	"log_raw": {
		Name:              "log_raw",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_raw"),
		Default:           int8(0),
	},
	"log_slow_admin_statements": {
		Name:              "log_slow_admin_statements",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_slow_admin_statements"),
		Default:           int8(0),
	},
	"log_slow_extra": {
		Name:              "log_slow_extra",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_slow_extra"),
		Default:           int8(0),
	},
	"log_syslog": {
		Name:              "log_syslog",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_syslog"),
		Default:           int8(1),
	},
	"log_syslog_facility": {
		Name:              "log_syslog_facility",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("log_syslog_facility"),
		Default:           "daemon",
	},
	"log_syslog_include_pid": {
		Name:              "log_syslog_include_pid",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("log_syslog_include_pid"),
		Default:           int8(1),
	},
	"log_syslog_tag": {
		Name:              "log_syslog_tag",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("log_syslog_tag"),
		Default:           "",
	},
	"log_timestamps": {
		Name:              "log_timestamps",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("log_timestamps", "UTC", "SYSTEM"),
		Default:           "UTC",
	},
	"log_throttle_queries_not_using_indexes": {
		Name:              "log_throttle_queries_not_using_indexes",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("log_throttle_queries_not_using_indexes", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"long_query_time": {
		Name:              "long_query_time",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemDoubleType("long_query_time", 0, math.MaxFloat64),
		Default:           float64(10),
	},
	"low_priority_updates": {
		Name:              "low_priority_updates",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("low_priority_updates"),
		Default:           int8(0),
	},
	"lower_case_file_system": {
		Name:              "lower_case_file_system",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("lower_case_file_system"),
		Default:           int8(0),
	},
	"lower_case_table_names": {
		Name:              "lower_case_table_names",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("lower_case_table_names", 0, 2, false),
		Default:           int64(0),
	},
	"mandatory_roles": {
		Name:              "mandatory_roles",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("mandatory_roles"),
		Default:           "",
	},
	"max_allowed_packet": {
		Name:              "max_allowed_packet",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_allowed_packet", 1024, 1073741824, false),
		Default:           int64(1073741824),
	},
	"max_connect_errors": {
		Name:              "max_connect_errors",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("max_connect_errors", 1, 18446744073709551615),
		Default:           uint64(100),
	},
	"max_connections": {
		Name:              "max_connections",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_connections", 1, 100000, false),
		Default:           int64(151),
	},
	"max_delayed_threads": {
		Name:              "max_delayed_threads",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_delayed_threads", 0, 16384, false),
		Default:           int64(20),
	},
	"max_digest_length": {
		Name:              "max_digest_length",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_digest_length", 0, 1048576, false),
		Default:           int64(1024),
	},
	"max_error_count": {
		Name:              "max_error_count",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("max_error_count", 0, 65535, false),
		Default:           int64(1024),
	},
	"max_execution_time": {
		Name:              "max_execution_time",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("max_execution_time", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"max_heap_table_size": {
		Name:              "max_heap_table_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("max_heap_table_size", 16384, 1844674407370954752),
		Default:           uint64(16777216),
	},
	"max_insert_delayed_threads": {
		Name:              "max_insert_delayed_threads",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_insert_delayed_threads", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"max_join_size": {
		Name:              "max_join_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("max_join_size", 1, 18446744073709551615),
		Default:           uint64(18446744073709551615),
	},
	"max_length_for_sort_data": {
		Name:              "max_length_for_sort_data",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("max_length_for_sort_data", 4, 8388608, false),
		Default:           int64(4096),
	},
	"max_points_in_geometry": {
		Name:              "max_points_in_geometry",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("max_points_in_geometry", 3, 1048576, false),
		Default:           int64(65536),
	},
	"max_prepared_stmt_count": {
		Name:              "max_prepared_stmt_count",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_prepared_stmt_count", 0, 4194304, false),
		Default:           int64(16382),
	},
	"max_seeks_for_key": {
		Name:              "max_seeks_for_key",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("max_seeks_for_key", 1, 18446744073709551615),
		Default:           uint64(18446744073709551615),
	},
	"max_sort_length": {
		Name:              "max_sort_length",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("max_sort_length", 4, 8388608, false),
		Default:           int64(1024),
	},
	"max_sp_recursion_depth": {
		Name:              "max_sp_recursion_depth",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_sp_recursion_depth", -9223372036854775808, 255, false),
		Default:           int64(0),
	},
	"max_user_connections": {
		Name:              "max_user_connections",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("max_user_connections", 0, 4294967295, false),
		Default:           int64(0),
	},
	"max_write_lock_count": {
		Name:              "max_write_lock_count",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("max_write_lock_count", 1, 18446744073709551615),
		Default:           uint64(18446744073709551615),
	},
	"mecab_rc_file": {
		Name:              "mecab_rc_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("mecab_rc_file"),
		Default:           "",
	},
	"metadata_locks_cache_size": {
		Name:              "metadata_locks_cache_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("metadata_locks_cache_size", 1, 1048576, false),
		Default:           int64(1024),
	},
	"metadata_locks_hash_instances": {
		Name:              "metadata_locks_hash_instances",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("metadata_locks_hash_instances", 1, 1024, false),
		Default:           int64(8),
	},
	"min_examined_row_limit": {
		Name:              "min_examined_row_limit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("min_examined_row_limit", 0, 18446744073709551615),
		Default:           uint64(0),
	},
	"myisam_data_pointer_size": {
		Name:              "myisam_data_pointer_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("myisam_data_pointer_size", 2, 7, false),
		Default:           int64(6),
	},
	"myisam_max_sort_file_size": {
		Name:              "myisam_max_sort_file_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("myisam_max_sort_file_size", -9223372036854775808, 9223372036853727232, false),
		Default:           int64(9223372036853727232),
	},
	"myisam_mmap_size": {
		Name:              "myisam_mmap_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("myisam_mmap_size", 7, 18446744073709551615),
		Default:           uint64(18446744073709551615),
	},
	"myisam_recover_options": {
		Name:              "myisam_recover_options",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("myisam_recover_options", "OFF", "DEFAULT", "BACKUP", "FORCE", "QUICK"),
		Default:           "OFF",
	},
	"myisam_repair_threads": {
		Name:              "myisam_repair_threads",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("myisam_repair_threads", 1, 18446744073709551615),
		Default:           uint64(1),
	},
	"myisam_sort_buffer_size": {
		Name:              "myisam_sort_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("myisam_sort_buffer_size", 4096, 18446744073709551615),
		Default:           uint64(8388608),
	},
	"myisam_stats_method": {
		Name:              "myisam_stats_method",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("myisam_stats_method", "nulls_equal", "nulls_unequal", "nulls_ignored"),
		Default:           "nulls_unequal",
	},
	"myisam_use_mmap": {
		Name:              "myisam_use_mmap",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("myisam_use_mmap"),
		Default:           int8(0),
	},
	"mysql_native_password_proxy_users": {
		Name:              "mysql_native_password_proxy_users",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("mysql_native_password_proxy_users"),
		Default:           int8(0),
	},
	"named_pipe": {
		Name:              "named_pipe",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("named_pipe"),
		Default:           int8(0),
	},
	"named_pipe_full_access_group": {
		Name:              "named_pipe_full_access_group",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("named_pipe_full_access_group"),
		Default:           "",
	},
	"ndbinfo_version": {
		Name:              "ndbinfo_version",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ndbinfo_version"),
		Default:           "",
	},
	"net_buffer_length": {
		Name:              "net_buffer_length",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("net_buffer_length", 1024, 1048576, false),
		Default:           int64(16384),
	},
	"net_read_timeout": {
		Name:              "net_read_timeout",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("net_read_timeout", 1, 9223372036854775807, false),
		Default:           int64(30),
	},
	"net_retry_count": {
		Name:              "net_retry_count",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("net_retry_count", 1, 18446744073709551615),
		Default:           uint64(10),
	},
	"net_write_timeout": {
		Name:              "net_write_timeout",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("net_write_timeout", 1, 9223372036854775807, false),
		Default:           int64(60),
	},
	"new": {
		Name:              "new",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("new"),
		Default:           int8(0),
	},
	"ngram_token_size": {
		Name:              "ngram_token_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("ngram_token_size", 1, 10, false),
		Default:           int64(2),
	},
	"offline_mode": {
		Name:              "offline_mode",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("offline_mode"),
		Default:           int8(0),
	},
	"old": {
		Name:              "old",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("old"),
		Default:           int8(0),
	},
	"old_alter_table": {
		Name:              "old_alter_table",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("old_alter_table"),
		Default:           int8(0),
	},
	"open_files_limit": {
		Name:              "open_files_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("open_files_limit", 0, 18446744073709551615),
		Default:           uint64(5000),
	},
	"optimizer_prune_level": {
		Name:              "optimizer_prune_level",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("optimizer_prune_level", 0, 1, false),
		Default:           int64(1),
	},
	"optimizer_search_depth": {
		Name:              "optimizer_search_depth",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("optimizer_search_depth", 0, 62, false),
		Default:           int64(62),
	},
	//TODO: add proper support for this
	//"optimizer_switch": {
	//	Name: "optimizer_switch",
	//	Scope: SystemVariableScope_Both,
	//	Dynamic: true,
	//	SetVarHintApplies: true,
	//	Type: NewSystemSetType("optimizer_switch"),
	//	Default: "",
	//},
	"optimizer_trace": {
		Name:              "optimizer_trace",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("optimizer_trace"),
		Default:           "",
	},
	"optimizer_trace_features": {
		Name:              "optimizer_trace_features",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("optimizer_trace_features"),
		Default:           "",
	},
	"optimizer_trace_limit": {
		Name:              "optimizer_trace_limit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("optimizer_trace_limit", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(1),
	},
	"optimizer_trace_max_mem_size": {
		Name:              "optimizer_trace_max_mem_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("optimizer_trace_max_mem_size", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(1048576),
	},
	"optimizer_trace_offset": {
		Name:              "optimizer_trace_offset",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("optimizer_trace_offset", -9223372036854775808, 9223372036854775807, true),
		Default:           int64(-1),
	},
	"original_server_version": {
		Name:              "original_server_version",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("original_server_version", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(80017),
	},
	"parser_max_mem_size": {
		Name:              "parser_max_mem_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("parser_max_mem_size", 10000000, 18446744073709551615),
		Default:           uint64(18446744073709551615),
	},
	"partial_revokes": {
		Name:              "partial_revokes",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("partial_revokes"),
		Default:           int8(0),
	},
	"password_history": {
		Name:              "password_history",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("password_history", 0, 4294967295, false),
		Default:           int64(0),
	},
	"password_require_current": {
		Name:              "password_require_current",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("password_require_current"),
		Default:           int8(0),
	},
	"password_reuse_interval": {
		Name:              "password_reuse_interval",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("password_reuse_interval", 0, 4294967295, false),
		Default:           int64(0),
	},
	"performance_schema": {
		Name:              "performance_schema",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("performance_schema"),
		Default:           int8(1),
	},
	"persisted_globals_load": {
		Name:              "persisted_globals_load",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("persisted_globals_load"),
		Default:           int8(1),
	},
	"persist_only_admin_x509_subject": {
		Name:              "persist_only_admin_x509_subject",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("persist_only_admin_x509_subject"),
		Default:           "",
	},
	"pid_file": {
		Name:              "pid_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("pid_file"),
		Default:           "",
	},
	"plugin_dir": {
		Name:              "plugin_dir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("plugin_dir"),
		Default:           "",
	},
	"port": {
		Name:              "port",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("port", 0, 65535, false),
		Default:           int64(3306),
	},
	"preload_buffer_size": {
		Name:              "preload_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("preload_buffer_size", 1024, 1073741824, false),
		Default:           int64(32768),
	},
	"print_identified_with_as_hex": {
		Name:              "print_identified_with_as_hex",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("print_identified_with_as_hex"),
		Default:           int8(0),
	},
	"protocol_compression_algorithms": {
		Name:              "protocol_compression_algorithms",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemSetType("protocol_compression_algorithms", "zlib", "zstd", "uncompressed"),
		Default:           "zlib,zstd,uncompressed",
	},
	"protocol_version": {
		Name:              "protocol_version",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("protocol_version", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	"proxy_user": {
		Name:              "proxy_user",
		Scope:             SystemVariableScope_Session,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("proxy_user"),
		Default:           "",
	},
	"pseudo_slave_mode": {
		Name:              "pseudo_slave_mode",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("pseudo_slave_mode"),
		Default:           int8(0),
	},
	"pseudo_thread_id": {
		Name:              "pseudo_thread_id",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("pseudo_thread_id", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	//TODO: implement block sizes
	//"query_alloc_block_size": {
	//	Name: "query_alloc_block_size",
	//	Scope: SystemVariableScope_Both,
	//	Dynamic: true,
	//	SetVarHintApplies: false,
	//	Type: NewSystemIntType("query_alloc_block_size", 1024, 4294967295, false),
	//	Default: int64(8192),
	//},
	"query_cache_size": {
		Name:              "query_cache_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("query_cache_size", 0, 18446744073709551615),
		Default:           int8(1),
	},
	"query_cache_type": {
		Name:              "query_cache_type",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("query_cache_type", "OFF", "ON", "DEMAND"),
		Default:           "OFF",
	},
	//"query_prealloc_size": {
	//	Name: "query_prealloc_size",
	//	Scope: SystemVariableScope_Both,
	//	Dynamic: true,
	//	SetVarHintApplies: false,
	//	Type: NewSystemUintType("query_prealloc_size", 8192, 18446744073709551615),
	//	Default: uint64(8192),
	//},
	"rand_seed1": {
		Name:              "rand_seed1",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("rand_seed1", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(0),
	},
	//TODO: implement block sizes
	//"range_alloc_block_size": {
	//	Name: "range_alloc_block_size",
	//	Scope: SystemVariableScope_Both,
	//	Dynamic: true,
	//	SetVarHintApplies: true,
	//	Type: NewSystemUintType("range_alloc_block_size", 4096, 18446744073709547520),
	//	Default: uint64(4096),
	//},
	"range_optimizer_max_mem_size": {
		Name:              "range_optimizer_max_mem_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("range_optimizer_max_mem_size", 0, 18446744073709551615),
		Default:           uint64(8388608),
	},
	"rbr_exec_mode": {
		Name:              "rbr_exec_mode",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("rbr_exec_mode", "IDEMPOTENT", "STRICT"),
		Default:           "STRICT",
	},
	"read_buffer_size": {
		Name:              "read_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("read_buffer_size", 8192, 2147479552, false),
		Default:           int64(131072),
	},
	"read_only": {
		Name:              "read_only",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("read_only"),
		Default:           int8(0),
	},
	"read_rnd_buffer_size": {
		Name:              "read_rnd_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("read_rnd_buffer_size", 1, 2147483647, false),
		Default:           int64(262144),
	},
	"regexp_stack_limit": {
		Name:              "regexp_stack_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("regexp_stack_limit", 0, 2147483647, false),
		Default:           int64(8000000),
	},
	"regexp_time_limit": {
		Name:              "regexp_time_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("regexp_time_limit", 0, 2147483647, false),
		Default:           int64(32),
	},
	"require_row_format": {
		Name:              "require_row_format",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("require_row_format"),
		Default:           int8(0),
	},
	"require_secure_transport": {
		Name:              "require_secure_transport",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("require_secure_transport"),
		Default:           int8(0),
	},
	"resultset_metadata": {
		Name:              "resultset_metadata",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("resultset_metadata", "FULL", "NONE"),
		Default:           "FULL",
	},
	"secondary_engine_cost_threshold": {
		Name:              "secondary_engine_cost_threshold",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemDoubleType("secondary_engine_cost_threshold", 0, math.MaxFloat64),
		Default:           float64(100000.000000),
	},
	"schema_definition_cache": {
		Name:              "schema_definition_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("schema_definition_cache", 256, 524288, false),
		Default:           int64(256),
	},
	"secure_file_priv": {
		Name:              "secure_file_priv",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("secure_file_priv"),
		Default:           "",
	},
	"select_into_buffer_size": {
		Name:              "select_into_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("select_into_buffer_size", 8192, 2147479552, false),
		Default:           int64(131072),
	},
	"select_into_disk_sync": {
		Name:              "select_into_disk_sync",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("select_into_disk_sync"),
		Default:           int8(0),
	},
	"select_into_disk_sync_delay": {
		Name:              "select_into_disk_sync_delay",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("select_into_disk_sync_delay", 0, 31536000, false),
		Default:           int64(0),
	},
	"session_track_gtids": {
		Name:              "session_track_gtids",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("session_track_gtids", "OFF", "OWN_GTID", "ALL_GTIDS"),
		Default:           "OFF",
	},
	"session_track_schema": {
		Name:              "session_track_schema",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("session_track_schema"),
		Default:           int8(1),
	},
	"session_track_state_change": {
		Name:              "session_track_state_change",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("session_track_state_change"),
		Default:           int8(0),
	},
	"session_track_system_variables": {
		Name:              "session_track_system_variables",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("session_track_system_variables"),
		Default:           "time_zone, autocommit, character_set_client, character_set_results, character_set_connection",
	},
	"session_track_transaction_info": {
		Name:              "session_track_transaction_info",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("session_track_transaction_info", "OFF", "STATE", "CHARACTERISTICS"),
		Default:           "OFF",
	},
	"sha256_password_auto_generate_rsa_keys": {
		Name:              "sha256_password_auto_generate_rsa_keys",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sha256_password_auto_generate_rsa_keys"),
		Default:           int8(1),
	},
	"sha256_password_private_key_path": {
		Name:              "sha256_password_private_key_path",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("sha256_password_private_key_path"),
		Default:           "private_key.pem",
	},
	"sha256_password_proxy_users": {
		Name:              "sha256_password_proxy_users",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sha256_password_proxy_users"),
		Default:           int8(0),
	},
	"sha256_password_public_key_path": {
		Name:              "sha256_password_public_key_path",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("sha256_password_public_key_path"),
		Default:           "public_key.pem",
	},
	"shared_memory": {
		Name:              "shared_memory",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("shared_memory"),
		Default:           int8(0),
	},
	"shared_memory_base_name": {
		Name:              "shared_memory_base_name",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("shared_memory_base_name"),
		Default:           "MYSQL",
	},
	"show_create_table_skip_secondary_engine": {
		Name:              "show_create_table_skip_secondary_engine",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("show_create_table_skip_secondary_engine"),
		Default:           int8(0),
	},
	"show_create_table_verbosity": {
		Name:              "show_create_table_verbosity",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("show_create_table_verbosity"),
		Default:           int8(0),
	},
	"show_old_temporals": {
		Name:              "show_old_temporals",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("show_old_temporals"),
		Default:           int8(0),
	},
	"skip_external_locking": {
		Name:              "skip_external_locking",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("skip_external_locking"),
		Default:           int8(1),
	},
	"skip_name_resolve": {
		Name:              "skip_name_resolve",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("skip_name_resolve"),
		Default:           int8(0),
	},
	"skip_networking": {
		Name:              "skip_networking",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("skip_networking"),
		Default:           int8(0),
	},
	"skip_show_database": {
		Name:              "skip_show_database",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("skip_show_database"),
		Default:           int8(0),
	},
	"slow_launch_time": {
		Name:              "slow_launch_time",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("slow_launch_time", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(2),
	},
	"slow_query_log": {
		Name:              "slow_query_log",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("slow_query_log"),
		Default:           int8(0),
	},
	"slow_query_log_file": {
		Name:              "slow_query_log_file",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("slow_query_log_file"),
		Default:           "host_name-slow.log",
	},
	"socket": {
		Name:              "socket",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("socket"),
		Default:           "/tmp/mysql.sock",
	},
	"sort_buffer_size": {
		Name:              "sort_buffer_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("sort_buffer_size", 32768, 18446744073709551615),
		Default:           uint64(262144),
	},
	"sql_auto_is_null": {
		Name:              "sql_auto_is_null",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("sql_auto_is_null"),
		Default:           int8(0),
	},
	"sql_big_selects": {
		Name:              "sql_big_selects",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("sql_big_selects"),
		Default:           int8(1),
	},
	"sql_buffer_result": {
		Name:              "sql_buffer_result",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("sql_buffer_result"),
		Default:           int8(0),
	},
	"sql_log_off": {
		Name:              "sql_log_off",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sql_log_off"),
		Default:           int8(0),
	},
	"sql_mode": {
		Name:              "sql_mode",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemSetType("sql_mode", "ALLOW_INVALID_DATES", "ANSI_QUOTES", "ERROR_FOR_DIVISION_BY_ZERO", "HIGH_NOT_PRECEDENCE", "IGNORE_SPACE", "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "NO_DIR_IN_CREATE", "NO_ENGINE_SUBSTITUTION", "NO_UNSIGNED_SUBTRACTION", "NO_ZERO_DATE", "NO_ZERO_IN_DATE", "ONLY_FULL_GROUP_BY", "PAD_CHAR_TO_FULL_LENGTH", "PIPES_AS_CONCAT", "REAL_AS_FLOAT", "STRICT_ALL_TABLES", "STRICT_TRANS_TABLES", "TIME_TRUNCATE_FRACTIONAL"),
		Default:           "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION",
	},
	"sql_notes": {
		Name:              "sql_notes",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sql_notes"),
		Default:           int8(1),
	},
	"sql_quote_show_create": {
		Name:              "sql_quote_show_create",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sql_quote_show_create"),
		Default:           int8(1),
	},
	"sql_require_primary_key": {
		Name:              "sql_require_primary_key",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("sql_require_primary_key"),
		Default:           int8(0),
	},
	"sql_safe_updates": {
		Name:              "sql_safe_updates",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("sql_safe_updates"),
		Default:           int8(0),
	},
	"sql_select_limit": {
		Name:              "sql_select_limit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemIntType("sql_select_limit", -9223372036854775808, 9223372036854775807, false),
		Default:           int64(2147483647),
	},
	"sql_warnings": {
		Name:              "sql_warnings",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("sql_warnings"),
		Default:           int8(0),
	},
	"ssl_ca": {
		Name:              "ssl_ca",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_ca"),
		Default:           "",
	},
	"ssl_capath": {
		Name:              "ssl_capath",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_capath"),
		Default:           "",
	},
	"ssl_cert": {
		Name:              "ssl_cert",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_cert"),
		Default:           "",
	},
	"ssl_cipher": {
		Name:              "ssl_cipher",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_cipher"),
		Default:           "",
	},
	"ssl_crl": {
		Name:              "ssl_crl",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_crl"),
		Default:           "",
	},
	"ssl_crlpath": {
		Name:              "ssl_crlpath",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_crlpath"),
		Default:           "",
	},
	"ssl_fips_mode": {
		Name:              "ssl_fips_mode",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("ssl_fips_mode", "OFF", "ON", "STRICT"),
		Default:           "OFF",
	},
	"ssl_key": {
		Name:              "ssl_key",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("ssl_key"),
		Default:           "",
	},
	"stored_program_cache": {
		Name:              "stored_program_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("stored_program_cache", 16, 524288, false),
		Default:           int64(256),
	},
	"stored_program_definition_cache": {
		Name:              "stored_program_definition_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("stored_program_definition_cache", 256, 524288, false),
		Default:           int64(256),
	},
	"super_read_only": {
		Name:              "super_read_only",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("super_read_only"),
		Default:           int8(0),
	},
	"syseventlog.facility": {
		Name:              "syseventlog.facility",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("syseventlog.facility"),
		Default:           "daemon",
	},
	"syseventlog.include_pid": {
		Name:              "syseventlog.include_pid",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("syseventlog.include_pid"),
		Default:           int8(1),
	},
	"syseventlog.tag": {
		Name:              "syseventlog.tag",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("syseventlog.tag"),
		Default:           "",
	},
	"system_time_zone": {
		Name:              "system_time_zone",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("system_time_zone"),
		Default:           "UTC",
	},
	"table_definition_cache": {
		Name:              "table_definition_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("table_definition_cache", 400, 524288, true),
		Default:           int64(-1),
	},
	"table_encryption_privilege_check": {
		Name:              "table_encryption_privilege_check",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("table_encryption_privilege_check"),
		Default:           int8(0),
	},
	"table_open_cache": {
		Name:              "table_open_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("table_open_cache", 1, 524288, false),
		Default:           int64(4000),
	},
	"table_open_cache_instances": {
		Name:              "table_open_cache_instances",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("table_open_cache_instances", 1, 64, false),
		Default:           int64(16),
	},
	"tablespace_definition_cache": {
		Name:              "tablespace_definition_cache",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("tablespace_definition_cache", 256, 524288, false),
		Default:           int64(256),
	},
	"temptable_max_mmap": {
		Name:              "temptable_max_mmap",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("temptable_max_mmap", 0, 18446744073709551615),
		Default:           uint64(1073741824),
	},
	"temptable_max_ram": {
		Name:              "temptable_max_ram",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemUintType("temptable_max_ram", 2097152, 18446744073709551615),
		Default:           uint64(1073741824),
	},
	"temptable_use_mmap": {
		Name:              "temptable_use_mmap",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("temptable_use_mmap"),
		Default:           int8(1),
	},
	"thread_cache_size": {
		Name:              "thread_cache_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_cache_size", 0, 16384, true),
		Default:           int64(-1),
	},
	"thread_handling": {
		Name:              "thread_handling",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("thread_handling", "no-threads", "one-thread-per-connection", "loaded-dynamically"),
		Default:           "one-thread-per-connection",
	},
	"thread_pool_algorithm": {
		Name:              "thread_pool_algorithm",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_algorithm", 0, 1, false),
		Default:           int64(0),
	},
	"thread_pool_high_priority_connection": {
		Name:              "thread_pool_high_priority_connection",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_high_priority_connection", 0, 1, false),
		Default:           int64(0),
	},
	"thread_pool_max_active_query_threads": {
		Name:              "thread_pool_max_active_query_threads",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_max_active_query_threads", 0, 512, false),
		Default:           int64(0),
	},
	"thread_pool_max_unused_threads": {
		Name:              "thread_pool_max_unused_threads",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_max_unused_threads", 0, 4096, false),
		Default:           int64(0),
	},
	"thread_pool_prio_kickup_timer": {
		Name:              "thread_pool_prio_kickup_timer",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_prio_kickup_timer", 0, 4294967294, false),
		Default:           int64(1000),
	},
	"thread_pool_size": {
		Name:              "thread_pool_size",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_size", 1, 512, false),
		Default:           int64(16),
	},
	"thread_pool_stall_limit": {
		Name:              "thread_pool_stall_limit",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("thread_pool_stall_limit", 4, 600, false),
		Default:           int64(6),
	},
	//TODO: implement block sizes
	//"thread_stack": {
	//	Name: "thread_stack",
	//	Scope: SystemVariableScope_Global,
	//	Dynamic: false,
	//	SetVarHintApplies: false,
	//	Type: NewSystemUintType("thread_stack", 131072, 18446744073709551615),
	//	Default: uint64(286720),
	//},
	"time_zone": {
		Name:              "time_zone",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemStringType("time_zone"),
		Default:           "SYSTEM",
	},
	//TODO: this needs to utilize a function as the value is not static
	"timestamp": {
		Name:              "timestamp",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemDoubleType("timestamp", 1, 2147483647),
		Default:           float64(1000.0),
	},
	"tls_ciphersuites": {
		Name:              "tls_ciphersuites",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("tls_ciphersuites"),
		Default:           "",
	},
	"tls_version": {
		Name:              "tls_version",
		Scope:             SystemVariableScope_Global,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("tls_version"),
		Default:           "TLSv1,TLSv1.1,TLSv1.2,TLSv1.3",
	},
	"tmp_table_size": {
		Name:              "tmp_table_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemUintType("tmp_table_size", 1024, 18446744073709551615),
		Default:           uint64(16777216),
	},
	"tmpdir": {
		Name:              "tmpdir",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("tmpdir"),
		Default:           GetTmpdirSessionVar(),
	},
	//TODO: implement block sizes
	//"transaction_alloc_block_size": {
	//	Name: "transaction_alloc_block_size",
	//	Scope: SystemVariableScope_Both,
	//	Dynamic: true,
	//	SetVarHintApplies: false,
	//	Type: NewSystemIntType("transaction_alloc_block_size", 1024, 131072, false),
	//	Default: int64(8192),
	//},
	"transaction_isolation": {
		Name:              "transaction_isolation",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("transaction_isolation", "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE"),
		Default:           "REPEATABLE-READ",
	},
	"transaction_prealloc_size": {
		Name:              "transaction_prealloc_size",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("transaction_prealloc_size", 1024, 131072, false),
		Default:           int64(4096),
	},
	"transaction_read_only": {
		Name:              "transaction_read_only",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("transaction_read_only"),
		Default:           int8(0),
	},
	"tx_isolation": {
		Name:              "tx_isolation",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemEnumType("tx_isolation", "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE"),
		Default:           "REPEATABLE-READ",
	},
	"tx_read_only": {
		Name:              "tx_read_only",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("tx_read_only"),
		Default:           int8(0),
	},
	"unique_checks": {
		Name:              "unique_checks",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("unique_checks"),
		Default:           int8(1),
	},
	"updatable_views_with_limit": {
		Name:              "updatable_views_with_limit",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("updatable_views_with_limit"),
		Default:           int8(1),
	},
	"use_secondary_engine": {
		Name:              "use_secondary_engine",
		Scope:             SystemVariableScope_Session,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemEnumType("use_secondary_engine", "OFF", "ON", "FORCED"),
		Default:           "ON",
	},
	"validate_user_plugins": {
		Name:              "validate_user_plugins",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemBoolType("validate_user_plugins"),
		Default:           int8(1),
	},
	"version": {
		Name:              "version",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("version"),
		Default:           "",
	},
	"version_comment": {
		Name:              "version_comment",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("version_comment"),
		Default:           "",
	},
	"version_compile_machine": {
		Name:              "version_compile_machine",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("version_compile_machine"),
		Default:           "",
	},
	"version_compile_os": {
		Name:              "version_compile_os",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("version_compile_os"),
		Default:           "",
	},
	"version_compile_zlib": {
		Name:              "version_compile_zlib",
		Scope:             SystemVariableScope_Global,
		Dynamic:           false,
		SetVarHintApplies: false,
		Type:              NewSystemStringType("version_compile_zlib"),
		Default:           "",
	},
	"wait_timeout": {
		Name:              "wait_timeout",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: false,
		Type:              NewSystemIntType("wait_timeout", 1, 31536000, false),
		Default:           int64(28800),
	},
	"windowing_use_high_precision": {
		Name:              "windowing_use_high_precision",
		Scope:             SystemVariableScope_Both,
		Dynamic:           true,
		SetVarHintApplies: true,
		Type:              NewSystemBoolType("windowing_use_high_precision"),
		Default:           int8(1),
	},
}
